public static int findTargetSumWays(int[] nums, int tagert) {
            int sum = 0;
            for (int n : nums) {
                sum += n;
            }
            if(sum < tagert || (tagert+sum) % 2 != 0) {
                return 0;
            }
            int p = (tagert + sum) / 2;
            int[] dp = new int[p+1];
            dp[0]=1;
            for(int num : nums){
                for(int i=p;i>=num;i--){
                    dp[i] += dp[i-num];
                }
            }
            return dp[p];
        }